{{Extend "layout"}}
{{Block "title"}}{{"任务分组"|T}}{{/Block}}
{{Block "breadcrumb"}}
{{Super}}
<li class="active">{{"任务分组"|T}}</li>
{{/Block}}
{{Block "main"}}
<div class="row">
	<div class="col-md-12">
		<div class="block-flat">
			<div class="header">
				<div class="pull-right" style="margin-left:10px">
					<form class="form-horizontal" action="" id="search-form" method="GET">
						<div class="input-group">
							<span class="input-group-addon">{{"类型"|T}}</span>
							<select name="type" class="form-control" id="type" onchange="$('#search-form').submit()">
								<option value="0"> - {{"不限"|T}} - </option>
								{{$type := Form "type"}} 
								<option value="page" {{if eq $type "page"}} selected{{end}}>{{"页面规则组"|T}}</option>
								<option value="export" {{if eq $type "export"}} selected{{end}}>{{"导出规则组"|T}}</option>
							</select>
						</div>
					</form>
				</div>
				<a href="__BACKEND__/collector/group_add" class="btn btn-success pull-right">
					<i class="fa fa-plus"></i>
					{{"添加分组"|T}}
				</a>
				<h3>{{"任务分组"|T}}</h3>
			</div>
			<div class="content">
				<div class="table-responsive">
				<table class="table no-border hover">
					<thead class="no-border">
						<tr>
							<th style="width:2%;"><strong>ID</strong></th>
							<th><strong>{{"组名称"|T}}</strong></th>
							<th><strong>{{"类型"|T}}</strong></th>
							<th><strong>{{"描述"|T}}</strong></th>
							<th style="width:15%;" class="text-center"><strong>{{"操作"|T}}</strong></th>
						</tr>
					</thead>
					<tbody class="no-border-y">
                        {{range $k,$v := Stored.listData}}
						<tr>
							<td>{{$v.Id}}</td>
							<td>{{$v.Name}}</td>
							<td>
								{{- if eq $v.Type "page" -}}
								页面规则组
								{{- else if eq $v.Type "export" -}}
								导出规则组
								{{- else -}}
								未设置
								{{- end -}}
							</td>
							<td>{{$v.Description}}</td>
							<td class="text-center">
							<a class="label label-success" href="__BACKEND__/collector/group_edit?id={{$v.Id}}"><i class="fa fa-pencil" data-toggle="tooltip" title="{{"编辑"|T}}"></i></a> 
							<a class="label label-danger" href="__BACKEND__/collector/group_delete?id={{$v.Id}}" onclick="return confirm('{{"真的要删除吗？"|T}}');" data-toggle="tooltip" title="{{"删除"|T}}"><i class="fa fa-times"></i></a>
							</td>
						</tr>
                        {{end}}
					</tbody>
				</table>		
				</div>
				{{Stored.pagination.Render}}
			</div>
		</div>				
	</div>
</div>
{{/Block}}